Skip to content

Allow setting a canonical URL via ogp_canonical_url #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

AA-Turner
Copy link
Member

This PR builds on #133, only the final commit is new.

We introduce a new setting, ogp_canonical_url, which defines the canonical or permanent URL for a webpage, similarly to rel="canonical". The motivating example is Python's documentation, where we have multiple different sites (e.g. 3.12, 3.13, 3.14), but we want search engines and other tools to use docs.python.org/3/ as the canonical URL.

I had considered solving this problem another way, by allowing the URL only for images to be changed, but I believe that this solution is conceptually better, and maps more closely to the description of og:url in the Open Graph Protocol specification.

Please let me know your thoughts and feedback!

A

@AA-Turner AA-Turner merged commit 16a394b into sphinx-doc:main Apr 3, 2025
51 checks passed
@AA-Turner AA-Turner deleted the image-base-url branch April 4, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant